package com.dmz.wxcp.wecom.wxbusiness.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

@Data
@TableName(value = "product_category")
public class ProductCategory {
    @TableId(value = "category_id",type = IdType.AUTO)
    private Integer categoryId;
    private String categoryName;
    private String detail;
    //创建时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    //更新时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;
    //    父级Id
    private Integer parentId;
    //    层级
    private Integer level;

    @TableField(exist = false)
    private List<ProductCategory> children = new ArrayList<>();
}
